package com.heima.article.job;

import com.heima.article.service.HotArticleService;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

@Component
public class HotArticleJob {

    @Autowired
    private HotArticleService hotArticleService;

    @XxlJob("computeHotArticleJob") //jobhandler名称
    public void computeHotArticleJob() {
        System.out.println("简单任务执行了。。。。start");
        hotArticleService.computeHotArticle();
        System.out.println("简单任务执行了。。。。end");
    }
}